package cn.gson.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the ANSWER_STYLE database table.
 * 
 */
@Entity
@Table(name="ANSWER_STYLE")
@NamedQuery(name="AnswerStyle.findAll", query="SELECT a FROM AnswerStyle a")
public class AnswerStyle implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="ANSWER_STYLE_ASID_GENERATOR", sequenceName="SEQ_2")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ANSWER_STYLE_ASID_GENERATOR")
	@Column(name="AS_ID")
	private long asId;

	@Column(name="AS_CATEGORY_CONTAIN")
	private String asCategoryContain;

	//bi-directional many-to-one association to AnswerQuestion
	@OneToMany(mappedBy="answerStyle")
	private List<AnswerQuestion> answerQuestions;

	public AnswerStyle() {
	}

	public long getAsId() {
		return this.asId;
	}

	public void setAsId(long asId) {
		this.asId = asId;
	}

	public String getAsCategoryContain() {
		return this.asCategoryContain;
	}

	public void setAsCategoryContain(String asCategoryContain) {
		this.asCategoryContain = asCategoryContain;
	}

	public List<AnswerQuestion> getAnswerQuestions() {
		return this.answerQuestions;
	}

	public void setAnswerQuestions(List<AnswerQuestion> answerQuestions) {
		this.answerQuestions = answerQuestions;
	}

	public AnswerQuestion addAnswerQuestion(AnswerQuestion answerQuestion) {
		getAnswerQuestions().add(answerQuestion);
		answerQuestion.setAnswerStyle(this);

		return answerQuestion;
	}

	public AnswerQuestion removeAnswerQuestion(AnswerQuestion answerQuestion) {
		getAnswerQuestions().remove(answerQuestion);
		answerQuestion.setAnswerStyle(null);

		return answerQuestion;
	}

}